﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/**
 * <Jason>
 * <Date: 20131210>
 */
namespace VietThuongLMS.ViewModels
{
    public class DiemDanhViewModel
    {
        public List<BangDiemDanh> List { get; set; }
        public int Total { get; set; }

        public List<DiemDanhMoRongModel> ListMoRong { get; set; }
        public int TotalMoRong { get; set; }
        public float TongTienCong { get; set; }

        public DiemDanhViewModel()
        {
            this.List = new List<BangDiemDanh>();
            this.ListMoRong = new List<DiemDanhMoRongModel>();
            this.Total = 0;
            this.TotalMoRong = 0;
        }

        public DiemDanhViewModel(List<BangDiemDanh> list, int total)
        {
            this.List = list;
            this.Total = total;
        }
        public DiemDanhViewModel(List<DiemDanhMoRongModel> list, int total)
        {
            this.ListMoRong = list;
            this.TotalMoRong = total;
        }
        //public void TinhTongTienCong()
        //{
        //    float sum = 0; 
        //    foreach (DiemDanhMoRongModel pcmrm in ListMoRong)
        //    {
        //        sum = sum + float.Parse(pcmrm.TienCong);
        //    }
        //    TongTienCong = sum;
        //}
    }

    //--K--
    public class DiemDanhMoRongModel
    {

        public BangDiemDanh bdd { get; set; }

        public string VangMat { get; set; }

        public string LyDo { get; set; }

        public DiemDanhMoRongModel()
        {
            // TODO: Complete member initialization
            bdd = new BangDiemDanh();
        }
    }
    //--EOK--

    public class LopHocMini
    {
        public int ID { get; set; }
        public string TenLopHoc { get; set; }
        public List<BangDiemDanhViewModel> BangDD { get; set; }
        public int MaHocVien { get; set; }

        public LopHocMini(int ID, string TenLopHoc, int MaHocVien)
        {
            this.ID = ID;
            this.TenLopHoc = TenLopHoc;
            this.BangDD = new List<BangDiemDanhViewModel>();
            this.MaHocVien = MaHocVien;
        }

        public LopHocMini()
        {
        }
    }

    public class ThongTinDiemDanhModel
    {
        public List<LopHocMini> lop { get; set; }
    }

    public class BangDiemDanhViewModel
    {
        public int ID { get; set; }
        public DateTime Ngay { get; set; }
        public int VangMat { get; set; }
        public string LyDo { get; set; }
        public string CaHoc { get; set; }

        public BangDiemDanhViewModel()
        {
            ID = -1;
            Ngay = new DateTime();
            VangMat = -1;
            LyDo = "";
            CaHoc = "";
        }

        public BangDiemDanhViewModel(int ID, DateTime Ngay, int VangMat, string LyDo, string CaHoc)
        {
            this.ID = ID;
            this.Ngay = Ngay;
            this.VangMat = VangMat;
            this.LyDo = LyDo;
            this.CaHoc = CaHoc;
        }
    }
        
}